//
//  OperationBlueTooth.h
//  Blue-toothLight
//
//  Created by mazg on 15/6/17.
//  Copyright (c) 2015年 mazg. All rights reserved.
//

#import <Foundation/Foundation.h>

#import <UIKit/UIKit.h>
#import <CoreBluetooth/CoreBluetooth.h>


@protocol OperationBlueToothDelegate <NSObject>

-(void)reloadTableViewDataWithAllPer:(NSMutableArray *)allPer andConnectedPer:(NSMutableArray *)connectedPer;

@end


@interface OperationBlueTooth : NSObject <CBCentralManagerDelegate,CBPeripheralDelegate>

@property (strong,nonatomic) CBCentralManager * cbCentralMgr;//中心设备管理器
@property (strong,nonatomic) NSMutableArray *perArr;//所有外围设备数组
@property (strong,nonatomic) NSMutableArray *perConnectedArr;//所有连上的外围设备数组
@property (strong,nonatomic) NSTimer *scanPerT;

@property (strong,nonatomic) NSArray *dataBaseArr;


@property (weak,nonatomic) id<OperationBlueToothDelegate>delegate;

//单粒对象
+(instancetype)shareOperationBlueToothInsatnce;
//搜索外围设备
-(void)scanForPeripherals;


-(void)addLog:(NSString*)log;//普通的调试信息
-(void)addLogWithService:(CBService*)service;//关于服务的调试信息
-(void)addLogWithCharacteristic:(CBCharacteristic*)characteristic;//关于特征的调试信息


@end
